<?php

Yii::import('zii.widgets.CListView');

class DListview extends CListView
{
  public $template = '{items}{pager}';
  public $cssFile = false;
  public $pager = array('class'=>'ext.mylib.widgets.Listview.DLinkPager');
  public $myPageSize;
  
  public function init()
	{
    //set pagesize
    $this->setDefaultVar();
    parent::init();
  }
  
  private function setDefaultVar()
  {
    //pagination
    if (empty($this->myPageSize))
      $this->myPageSize = Yii::app()->params['front_page_size'];
    $this->dataProvider->pagination->pageSize = $this->myPageSize;
  }
  
  public function renderEmptyText()
  {
    $htmlOptions = array(
      'class' => 'color_6',
      'style' => 'padding: 25px 10px;'
    );
    echo CHtml::openTag('div', $htmlOptions);
    echo '<p>' . Yii::t('app', 'front_no_result') . '</p>';
    echo '<p>' . CHtml::link('Quay về trang trước', Yii::app()->user->returnUrl) . '</p>';
    echo CHtml::closeTag('div');
  }    
}